<!DOCTYPE html>
<html>
  <head>
    <title>选择团队</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">

    <link rel="stylesheet" type="text/css" href="static/css/School.css">
	<meta charset="utf-8">
	  <style>
		  .tuichu{
			  width:50px;height:30px;margin-left:600px;border: none;border-radius: 5px;
			  cursor: pointer;background-color: #FFA24D;
			  color: #FFF;font-weight: bold;letter-spacing: 1px;

		  }
		  .sousuo{
			  width:50px;height:35px;border: none;border-radius: 5px;
			  cursor: pointer;background-color: dodgerblue;
			  color: #FFF;font-weight: bold;letter-spacing: 1px;

		  }
		  .outDiv input{
			  width:200px;
			  height:35px;
			  border:1px solid #ccc;
			  border-radius: 5px;
			  margin-left: 50px;
		  }
	  </style>
  </head>
  
  <body>
    <div class="wholeDiv">
    	<div class="topTitle">
    		<div class="outDiv">
    			<div class="schTxt"></div>
				<div class="schTxt">团队选择</div>
				<input type="search" id="search" name="search" value="" placeholder="请输入队伍名称" />
				<button type="button" onclick="search();" class="sousuo">搜索</button>
				<button type="button"  onclick="logout();" class="tuichu">Exit</button>
    		</div>
    	</div>
    	<div class="container">
    		<div class="schoolArea" id="ajaxGetTeam">
				{volist name='campus' id='campu'}
					<div class="school">
						<a href="javascript:doPost('','{$campu.team_id}');" title="{$campu.team_name}"><div class="sclName">{$campu.team_name}</div></a>
						<div class="infoContainer">
							<div class="address txt"> 团队编号: {$campu.team_number}</div>
							<div class="openTime txt">创办时间 : <?php echo substr($campu['team_time'],0,10); ?></div>
						</div>
						<a href="javascript:doPost('','{$campu.team_id}');" title="{$campu.team_name}"  ><div class="managerBtn">管理团队</div></a>
					</div>
				{/volist}
    		</div>
    	</div>
    	<div class="bottomInfo">
    		<!--<div class="bottomOut">-->
    			<!--<div class="botTxt" style="border-left:0;">关于我们</div>-->
    			<!--<div class="botTxt">新闻中心</div>-->
    			<!--<div class="botTxt">资质荣誉</div>-->
    			<!--<div class="botTxt">网站地图</div>-->
    			<!--<div class="botTxt">友情链接</div>-->
    			<!--<div class="botTxt">联系我们</div>-->
    		<!--</div>-->
    		<div class="banquan">Copyright©2015-2016 版权所有</div>
    	</div>
    </div>
	<script src="static/plugins/jquery/jquery.min.js"></script>

	<script src="static/js/TeachDialog.js"></script>
	<script>
        function logout() {
            $.ajax({
                url: "admin/Admin/authLogout",
                type: 'post',
                async: false,
                success: function (r) {
                    if (r == "1") {
                        var ref = "";

                        if (window.location.href.indexOf('ref=') != -1) {
                            ref = window.location.href.replace(/(.*?)ref=\//, '');
                        } else if (window.location.href.indexOf('?campusId=') != -1) {
                            ref = window.location.href.substring(0, window.location.href.indexOf('?campusId='));
                        }
                        window.location.href = ref;
                    }

                }

            });
        }
        function search() {
            var search  =$('#search').val();
            $.ajax({
                url: "admin/Index/getSearchTeam",
                type: 'POST',
				dataType:'HTML',
				data:'search='+search,
                success: function (data) {
                    if(data == 1){
                        $('#ajaxGetTeam').empty();
					}else{
                        $('#ajaxGetTeam').html(data);
					}
                }

            });
        }

	</script>
	<script>
		function doPost(to, p) {  // to:提交动作（action）,p:参数
			var myForm = document.createElement("form");
			myForm.method = "post";
			myForm.action = to;
			var myInput = document.createElement("input");
			myInput.setAttribute("name", "campusId");  // 为input对象设置name
			myInput.setAttribute("value", p);  // 为input对象设置value
			myInput.setAttribute("type", "hidden");
			myForm.appendChild(myInput);

			document.body.appendChild(myForm);
			myForm.submit();
			document.body.removeChild(myForm);  // 提交后移除创建的form
		}
	</script>
  </body>
</html>
